package com.ramnight.sql2.core;

import javax.sql.DataSource;

import com.ramnight.sql2.dialect.Dialect;
import com.ramnight.sql2.dialect.Mysql;

public class Sql2 {
	private static Dialect dialect;
	private static String pk = "id";
	
	public static void init(DataSource dataSource){
		init(dataSource, new Mysql());
	}
	
	public static void init(DataSource dataSource, Dialect dialect){
		DB.setDriver(new DbDriver(dataSource));;
		Sql2.dialect = dialect;
	}
	
	public static void setPk(String primaryKey){
		pk = primaryKey;
	}
	
	public static Dialect getDialect(){
		return dialect;
	}
	
	public static String getPk(){
		return pk;
	}
}
